import java.util.Arrays;

class Solution1 {
    public int countSegments(String s) {
        int count = 0;
        // 按照空格拆分
        String[] result = s.split(" ") ;
        for (int i = 0; i < result.length; i++) {
            if (result[i].length() != 0) {
                count++;
            }
        }
        return count;
    }
}

class Solution {
    public String toLowerCase(String s) {
        StringBuilder stringBuilder = new StringBuilder();
        //遍历字符数组
        for(int i = 0; i < s.length(); i++) {
            //获取下标的字母
            char ch = s.charAt(i);
            //判断是否是字母，用isLetter
            if(Character.isLetter(ch)) {
                //判断是不是大写字母
                if(Character.isUpperCase(ch)){
                    //转成小写
                    ch = (char)(ch + 32);
                }
            }
            //拼接
            stringBuilder.append(ch);
        }
        return stringBuilder.toString();
    }
}

class TestClass {

    /*private static void testMethod(){
        System.out.println("testMethod");
    }
    public static void main7(String[] args) {
        ((TestClass)null).testMethod();
    }*/
}



class SystemUtil{
    public static boolean isAdmin(String userId){
        return userId.toLowerCase()=="admin";
    }
    public static void main3(String[] args){
        System.out.println(isAdmin("Admin"));//false
    }
}

class Example{
    String str = new String("good");
    char[ ] ch = { 'a' , 'b' , 'c' };
    public static void main2(String args[]){
        Example ex = new Example();
        ex.change(ex.str,ex.ch);
        System.out.print(ex.str + " and ");//good and gbc
        System.out.print(ex.ch);
    }
    public void change(String str,char ch[ ]){
        str = "test ok";
        ch[0] = 'g';
    }
}

public class Main {

    

    public static void main(String[] args) {
        String str = "hello world hello bit" ;
        int count = 0;
        String[] result = str.split(" ") ; // 按照空格拆分
        for (int i = 0; i < result.length; i++) {
            if (result[i] != null) {
                count++;
            }
            //System.out.println(result[i]);
        }
        /*for(String s: result) {
            System.out.println(s);
        }*/
    }

    public static void main5(String[] args) {
        String str1 = "abcdefghi";
        String str2 = "cde";
        System.out.println(str1.contains(str2));
    }

    public static void main4(String[] args) {
        String s1="abc"+"def";//1
        String s2=new String(s1);//2
        if(s1.equals(s2))//3
            System.out.println(".equals succeeded");//4
        if(s1==s2)//5
            System.out.println("==succeeded");//6
    }

    public static void main1(String[] args) {
        int[] array = new int[]{1, 2, 3};
        for (int i = 0; i < array.length; i++) {
            array[i] = array[i] * 2;
        }
        System.out.println(Arrays.toString(array));
    }
}